﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;
using Puzzler.Common;

namespace Puzzler.Plugin.Interface
{
    public abstract class PuzzleInputHandler<TModel> : IPuzzleInputHandler, IModelable<TModel> where TModel : PuzzleModel
    {
        public TModel Model { get; private set; }

        protected PuzzleInputHandler(TModel model)
        {
            Model = model;
        }

        #region Mouse

        /// <summary>
        /// Is called if the left mouse button goes down
        /// </summary>
        /// <param name="e">Mouse-Event</param>
        /// <param name="point">Point of click relative to canvas</param>
        /// <returns>Action result to run action after call</returns>
        public virtual void OnLeftMouseButtonDown(Point point, MouseButtonEventArgs e)
        {
            
        }

        public virtual void OnLeftMouseButtonUp(Point point, MouseButtonEventArgs e)
        {
            
        }

        public virtual void OnRightMouseButtonDown(Point point, MouseButtonEventArgs e)
        {
            
        }

        public virtual void OnRightMouseButtonUp(Point point, MouseButtonEventArgs e)
        {
            
        }

        public virtual void OnMouseMove(Point point, MouseEventArgs e)
        {
            
        }

        public virtual void OnMouseWheel(Point point, MouseWheelEventArgs e)
        {
            
        }

        #endregion

        #region Key

        public virtual void OnKeyDown(KeyEventArgs e)
        {
            
        }

        public virtual void OnKeyUp(KeyEventArgs e)
        {
            
        }

        #endregion

        #region Plugin Action

        public virtual void OnInitialized()
        {
        }

        public virtual void OnDone()
        {
        }

        public virtual void OnActivated()
        {
        }

        public virtual void OnDeactivated()
        {
        }

        #endregion
    }
}
